<template>
  <div class="grabOrders">
    <div class="item" v-for="item in patientbillList" :key="item.index">
      <el-container>
        <el-aside width="100px">
          <el-avatar size="large"
                     src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
          />
        </el-aside>
        <el-container>
          <el-header height="50px">病因：{{ item.illness }}</el-header>
          <el-main>预约时间：{{ item.createTime }}</el-main>
          <el-footer height="100px">患者姓名：{{ item.patientName }}     <el-button type="primary" plain>抢单</el-button></el-footer>
        </el-container>
      </el-container>
    </div>
  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "grabOrders",
  components: {},
  data(){
    return{
      //病人发布的单子列表
      patientbillList:[],
    }
  },
  beforeCreate() {
    const options = {
      method: 'GET',
      url: 'http://106.54.189.155:6768/appointmentNeed/queryAll',
      headers: {Accept: '*/*'}
    };
    axios.request(options).then(response=> {
      this.patientbillList=response.data.data;
      console.log(response.data);
    }).catch(function (error) {
      console.error(error);
    });
  }
};
</script>

<style lang="scss" scope>
.grabOrders {
  width: 100%;
  height: auto;
  padding: 20px;
  overflow: hidden;
  &_item{
    width: 100%;
    display: flex;
    height: auto;
  }
}
</style>
